const Login = resolve => require(['./components/Login.vue'], resolve);
const NotFound = resolve => require(['./components/404.vue'], resolve);
const Home = resolve => require(['./components/Home.vue'], resolve);
const Main = resolve => require(['./components/Main.vue'], resolve);
const index = resolve => require(['./components/pages/index.vue'], resolve);
const introduce = resolve => require(['./components/pages/introduce.vue'], resolve);
const newsCenter = resolve => require(['./components/pages/newsCenter.vue'], resolve);
const policies = resolve => require(['./components/pages/policies.vue'], resolve);
const charity = resolve => require(['./components/pages/charity.vue'], resolve);
const acquaintingPagoda = resolve => require(['./components/pages/acquaintingPagoda.vue'], resolve);
const pageList = resolve => require(['./components/pages/pageList.vue'], resolve);
const details = resolve => require(['./components/pages/details.vue'], resolve);
const pageListSearch = resolve => require(['./components/pages/pageList-search.vue'], resolve);

let routes = [{
        path: '/login',
        component: Login,
        name: '',
        hidden: true
    },
    {
        path: '/404',
        component: NotFound,
        name: '',
        hidden: true
    },
    {
        path: '/main',
        component: Main,
        hidden: true
    },
    {
        path: '/',
        redirect: 'index'
    },
    {
        path: '/Home',
        component: Home,
        name: '主页',
        children: [{
                path: '/index',
                component: index,
                name: '主页',
                hidden: true,
                meta: {
                    title: '主页'
                }
            },
            {
                path: '/introduce',
                component: introduce,
                name: 'introduce',
                hidden: true,
                meta: {
                    title: '本会介绍'
                }
            },
            {
                path: '/newsCenter',
                component: newsCenter,
                name: 'newsCenter',
                hidden: true,
                meta: {
                    title: '新闻中心'
                }
            },
            {
                path: '/policies',
                component: policies,
                name: 'policies',
                hidden: true,
                meta: {
                    title: '政策法规'
                }
            },
            {
                path: '/charity',
                component: charity,
                name: 'charity',
                hidden: true,
                meta: {
                    title: '慈善公益'
                }
            },
            {
                path: '/acquaintingPagoda',
                component: acquaintingPagoda,
                name: 'acquaintingPagoda',
                hidden: true,
                meta: {
                    title: '寺院场所'
                }
            },
            {
                path: '/pageList/:id',
                component: pageList,
                name: 'pageList',
                hidden: true
            },
            {
                path: '/pageListSearch/:id',
                component: pageListSearch,
                name: 'pageList',
                hidden: true
            },
            {
                path: '/details/:id',
                component: details,
                name: '',
                hidden: true
            }
        ]
    },
    {
        path: '*',
        hidden: true,
        redirect: {
            path: '/404'
        }
    }
];

export default routes;